@extends('admin.layouts.index')
@section('title', '通过密钥绑定小程序')

@section('content')
<script type="text/javascript" src="https://file.wailian1.cn/admin/assets/admin/js/public/miniapp.setting.min.js"></script>
<div class="row">
    <div class="col-md-12">
        <form id="comment-form" method="POST" action="{{ URL::current() }}" enctype="multipart/form-data">
            <div class="card">
                <div class="card-body">
                    <div class="m-form-item">
                        <label><b>*</b>小程序名称:<font>仅用于自己区分</font></label>
                        <div class="m-col-3 m-xs-12">
                            <input type="text" class="m-input" name="name" id="name" placeholder="例如：查排行小程序" value="" maxlength="35">
                        </div>
                        @csrf
                    </div>
                    <div class="m-form-item">
                        <label><b>*</b>小程序AppId:</label>
                        <div class="m-col-3 m-xs-12">
                            <input type="text" class="m-input" name="appid" id="appid" placeholder="例如：wx8ff8b86****88888" value="" maxlength="18">
                        </div>
                    </div>
                    <div class="m-form-item">
                        <label><b>*</b>小程序AppSecret:</label>
                        <div class="m-col-6 m-xs-12">
                            <input type="text" class="m-input" name="secret" id="secret" placeholder="例如：86a5e34405*****f071ddc86dea77777" value="" maxlength="32">
                        </div>
                    </div>
                    <div class="m-form-item">
                        <label><b>*</b>小程序原始ID:</label>
                        <div class="m-col-3 m-xs-12">
                            <input type="text" class="m-input" name="original_id" id="original_id" placeholder="例如：gh_f6600****888" value="" maxlength="15">
                        </div>
                    </div>
                    @if(Auth::user()->authority == 3)
                    <div class="m-form-item">
                        <label>小程序类型:</label>
                        <div class="m-col-3 m-xs-12">
                            <select class="m-select" name="status" id="status" onchange="miniappAddStatusChange();">
                                <option value="1" selected>独家小程序</option>
                                <option value="2">公用小程序</option>
                            </select>
                        </div>
                    </div>
                    <div class="m-form-item" id="type_group" style="display:none;">
                        <label>小程序用途(公用时有效):</label>
                        <div class="m-col-3 m-xs-12">
                            <select class="m-select" name="type" id="type">
                                <option value="1" selected>通用小程序</option>
                                <option value="6">免费用户使用</option>
                                <option value="3">二维码专用</option>
                                <option value="4">客服专用</option>
                                <option value="5">点击版专用</option>
                                <option value="2">公众号专用(已弃用)</option>
                            </select>
                        </div>
                    </div>
                    <div class="m-form-item" id="users_id">
                        <label><b>*</b>用户ID:<font>如果不知道用户ID,可以前往<a target="_blank" href="{{ url('/admin/links_lists/users_lists') }}">用户列表</a>查看。</font></label>
                        <div class="m-col-3 m-xs-12">
                            <input type="text" class="m-input" name="users_id" id="users_id" placeholder="用户ID,独家小程序时可用！" value="{{ old('users_id') }}">
                        </div>
                    </div>
                    <div class="m-form-item">
                        <label><b>*</b>小程序状态:</label>
                        <div class="m-col-3 m-xs-12">
                            <select class="m-select" name="disable" id="disable">
                                <option value="1">作为备用</option>
                                <option value="2">禁用小程序</option>
                                <option value="3">设为默认</option>
                            </select>
                        </div>
                    </div>
                    @endif
                    <div class="m-form-item">
                        <label>小程序开发者:</label>
                        <div class="m-col-3 m-xs-12">
                            <select class="m-select" name="scene" id="scene">
                                <option value="1">自有微信小程序</option>
                                <option value="2">天天外链后台上架的小程序</option>
                            </select>
                        </div>
                    </div>

                    <div class="m-form-item">
                        <div class="m-form-btn m-mr-1" onclick="miniappAddSubmit();">立即添加小程序</div>
                    </div>
                    <div class="m-info-item">
                        <label>配置教程：</label>
                        <div class="links">
                            <p>不会配置请点击查看 </p>
                            <a target="_blank" href="{{ url('/admin/articles/app_articles_detial/14') }}"><i class="iconfont icon-bangzhu1"></i>小程序参数获取以及配置教程</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
@endsection
